package pers.csw.lookBook.controller.front;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.csw.lookBook.common.Res;
import pers.csw.lookBook.service.RecommendService;

@RestController
@CrossOrigin
@RequestMapping("/index")
public class IndexController {

    final
    RecommendService recommendService;

    public IndexController(RecommendService recommendService) {
        this.recommendService = recommendService;
    }

    /**
     * @return 返回首页推荐的书籍
     */
    @GetMapping("/getHome")
    public Res getHome(){
        return Res.success(recommendService.getHome());
    }

}
